package com.yurui.tx;

import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.transaction.annotation.Transactional;

/**
 * @author : yurui
 * @date : 2025/6/15
 * @TIME : 13:48
 * @project : spring
 */
public class BookService {

    private JdbcTemplate jdbcTemplate;

    @Transactional
    public void updateBook(String id,String name){
        jdbcTemplate.update("update test.book set book_name = ? where id = ?",new Object[]{name,id});
    }

    public void setJdbcTemplate(JdbcTemplate jdbcTemplate) {

        this.jdbcTemplate = jdbcTemplate;

    }

}
